package edu.put.sk.nrpp;
import java.net.Inet4Address;

import edu.put.sk.nrpp.ui.GraphicsConnection;
import edu.put.sk.nrpp.ui.Router;

public class Connection {
	public Router r1;
	public Router r2;
	Inet4Address ipR1;
	Inet4Address ipR2;
	public GraphicsConnection graphicsConnection;
	public Inet4Address maskLinks;
	public Connection(ConnectionList connectionList,Router r1, Router r2){
		this.r1=r1;
		this.r2=r2;
		connectionList.addConnection(this);
	}
	public void linkGC(GraphicsConnection _graphicsConnection){
		this.graphicsConnection = _graphicsConnection;
	}
	
	public Router getNeighbor(Router router){
		if (router.equals(r1)){
			return r2;
		}
		
		return r1;
	}
}
